package com.pcitc.app.dao;

import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UsernameNotFoundException;
import com.pcitc.app.model.TblUser;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * User Data Access Object (GenericDao) interface.
 */
public interface TblUserDao extends GenericDao<TblUser, Long> {

    
	/** 
     *根据用户名查找用户
    */
    @Transactional
    TblUser loadUserByUsername(String username);
    /** 
     * 根据用户ID查找用户
    */
    TblUser loadUserByUserId(Long userid);
    /** 
     * 根据USER超找用户
    */
    List<TblUser> findByExample(TblUser tblUser);
    /**
     * 获取组织机构列表
     */
    List<TblUser> getUserList();
    /**
     * 保存用户
     */
    void saveUser(TblUser tblUser);
    /**
     * 更新用户
     */
    TblUser upateUser(TblUser tblUser);
    /** 
     * 删除用户
    */
    void removeUser(TblUser tblUser);
    /** 
     * 根据用户ID删除用户
    */
    void removeUserByID(Long userid);
    /** 
     * 删除所有
    */
    void removeAll(List<TblUser> tblUsers);
    /** 
     *检查用户名密码 返回USER
    */ 
    TblUser checkUserPassword(String userName, String pwd);
    /** 
     *检查用户名密码 返回Boolea值ֵ
    */
    boolean isValidUser(String userName, String pwd);
    /** 
     * 检查用户ID是否存在 返回Booleanֵ值
    */
    boolean checkUserId(Long userid);
    /** 
     * 修改用户密码
    */
    boolean changePwd(Long userId,String oldPwd, String newPwd);
    /** 
     *获取用户密码
    */
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    String getUserPassword(String username);
     
}
